/**********************************************************************************
// SpaceShip
// 
// Creation:	14 Set 2008
// Updated:		11 Out 2009
// Compiler:	Visual Studio 2008
//
// Notes:		Defines a space ship for asteroids game
//
**********************************************************************************/

#include "SpaceShip.h"

/**********************************************************************************/

SpaceShip::SpaceShip()
{
	speed.SetVector(90.0f, 0.0f);		// starts upward and still
	direction.SetVector(90.0f, 0.0f);	// starts upward and still
	customType = objShip;				// ship type object
}

/**********************************************************************************/

void SpaceShip::Rotate(float ang)
{
	// rotate SpaceShip
	Poly::Rotate(ang);
	
	// set new direction
	direction.Rotate(ang);
}

/**********************************************************************************/

void SpaceShip::AccelerateUp()
{
	direction.SetMagnitude(0.30f);
	speed.Add(direction);
}

/**********************************************************************************/

void SpaceShip::AccelerateDown()
{
	direction.SetMagnitude(-0.30f);
	speed.Add(direction);
}

/**********************************************************************************/

void SpaceShip::Inertia()
{
	Translate(speed.GetX(), -1.0f * speed.GetY());
}

/**********************************************************************************/

void SpaceShip::Reset()
{
	speed.SetVector(90.0f, 0.0f);
	direction.SetVector(90.0f, 0.0f);
}

/**********************************************************************************/